package com.bootdo.system.service.impl;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.bootdo.system.dao.CustomerMapper;
import com.bootdo.system.domain.Customer;
import com.bootdo.system.service.CustomerService;
import com.github.pagehelper.PageHelper;



@Service("customerService")
public class CustomerServiceImpl implements CustomerService {
	@Autowired
	private CustomerMapper customerMapper;
	
	@Override
	public Customer get(Long id){
		return customerMapper.get(id);
	}
	
	@Override
	public List<Customer> list(Map<String, Object> map){
		PageHelper.startPage(Integer.parseInt(map.get("pageNum").toString()),Integer.parseInt(map.get("pageSize").toString()));
		return customerMapper.list(map);
	}
	
	@Override
	public int count(Map<String, Object> map){
		return customerMapper.count(map);
	}
	
	@Override
	public int save(Customer bComments){
		return customerMapper.save(bComments);
	}
	
	@Override
	public int update(Customer bComments){
		return customerMapper.update(bComments);
	}
	
	@Override
	public int remove(Long id){
		return customerMapper.remove(id);
	}
	
	@Override
	public int batchRemove( Integer[] ids){
		return customerMapper.batchRemove(ids);
	}

	@Override
	public int checkLinkerPhone(Map<String, Object> map) {
		return customerMapper.checkLinkerPhone(map);
	}

	@Override
	public Customer getByPhone(String linkerPhone) {
		return customerMapper.getByPhone(linkerPhone);
	}

}
